package com.example.keli.ui.userinfo;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.example.keli.R;
import com.example.keli.base.App;
import com.example.keli.base.AppConfig;
import com.example.keli.base.utils.DialogCall;
import com.example.keli.base.utils.DialogUtil;
import com.example.keli.base.utils.SPUtils;

import org.greenrobot.eventbus.EventBus;


public class GlobalDialogActivity extends Activity
{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.system_global_dialog);
		showDialog();
	}
	public static void start(Context context) {
		Intent intent = new Intent(context, GlobalDialogActivity.class);
		context.startActivity(intent);
	}

	protected void showDialog() {
		DialogUtil.showTipStr(GlobalDialogActivity.this, "提示", "Token过期,请重新登录", new DialogCall() {
			@Override
			public void onPositive() {
				SPUtils.clear(App.getContext());
				finish();
				EventBus.getDefault().post(AppConfig.QUIT_LOGIN);
			}

			@Override
			public void onNegative() {

			}

		});
	}
}
